# Contributor: Roman Kyrylych <roman@archlinux.org>

pkgname=gnome-user-share
pkgver=3.34.0
pkgrel=2
pkgdesc="Easy to use user-level file sharing for GNOME"
arch=(x86_64)
url="https://gitlab.gnome.org/GNOME/gnome-user-share"
license=(GPL)
depends=(mod_dnssd dconf gtk3 libnotify libcanberra)
makedepends=(libnautilus-extension git meson yelp-tools)
groups=(gnome)
_commit=6f5213ad76e78f0ea3040610ce9fa94a59505913  # tags/GNOME_USER_SHARE_3_34_0^0
source=("git+https://gitlab.gnome.org/GNOME/gnome-user-share.git#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^GNOME_USER_SHARE_//;s/_/./g;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  arch-meson $pkgname build \
    -D httpd=/usr/bin/httpd \
    -D modules_path=/usr/lib/httpd/modules \
    -D nautilus_extension=true
  ninja -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  DESTDIR="$pkgdir" meson install -C build
}
